import * as React from 'react'
import { Link } from 'react-router-dom';
import { Tabs, Breadcrumb } from 'antd'
import { connect } from "react-redux"
import { IStoreState } from '@/types'
import ProjectMember from './components/ProjectMember';
import ProjectInfo from './components/ProjectInfo';
import Sourcemap from './components/Sourcemap';
import style from './ProjectDetails.less';


const TabPane = Tabs.TabPane
const BreadcrumbItem = Breadcrumb.Item;


interface Props {

	projectName: string
}


// function onChange(activeKey: string, tabs: string[], func1, fun2, fun3) {
//   const args = Array.prototype.slice.call(arguments, 2);
//   const func = args[parseInt(activeKey, 10) - 1];
//   return tabs.indexOf(activeKey) === -1 && func && func();

// }
function ProjectDetails({ projectName }: Props) {

	return (
		<div className={style.wrapper}>
			<Breadcrumb>
				<BreadcrumbItem>
					<Link to='/project'>项目列表</Link>
				</BreadcrumbItem>
				<BreadcrumbItem>
					{projectName}
				</BreadcrumbItem>
			</Breadcrumb>
			<Tabs defaultActiveKey="1">
				<TabPane tab="基本信息" key="1">
					<div className={style.content}>
						<ProjectInfo />
					</div>
				</TabPane>
				<TabPane tab="成员管理" key="3">
					<ProjectMember className={style.content} />
				</TabPane>
				<TabPane tab="sourmap上传" key="4">
					<Sourcemap className={style.content} />
				</TabPane>
			</Tabs>
		</div>
	)
}



const mapStateToProps = (state: IStoreState) => {
	const { projectName } = state.project;
	return {

		projectName

	}
};

export default connect(mapStateToProps)(ProjectDetails);